package com.itheima.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.itheima.domain.User;
import com.itheima.service.UserService;

@Controller
@RequestMapping(value="/user")
public class UserController {
	
	@Autowired
	private UserService userService;
	
	@RequestMapping("/findUserList")
	public ModelAndView findUserList(ModelAndView mv){
		List<User> findUserList = userService.findUserList();
		mv.addObject("userList", findUserList);
		mv.setViewName("user-list");
		return mv;
	}
}

